<%@ include file="header.jsp" %>
<%@ page import="java.util.ArrayList" %>
    <!-- Three columns -->
    <%
    
    ArrayList<Integer> results = (ArrayList<Integer>) session.getAttribute("results");
    String pageNumString = request.getParameter("page");
    int pageNum=0;
    if (pageNumString != null)
    	pageNum = Integer.parseInt(pageNumString);
    %>
    <div class="content box">
    
        <div class="content-in box">
	
            <h2><!-- /col50 -->            </h2>
            <div class="fix"></div>

	<table>
     <tr>
        <th></th>
        <th width=500>Results</th>
    </tr>
	<%for(int i=pageNum*10;i<results.size() && i < (pageNum+1)*10; i++) {
		int resultID = results.get(i);
		if (resultID == userID){
			results.remove(i);
			i--;
			continue;
		}
	%>
         <tr <% if (i%2==0){%>class="odd"<%} %>>
             <td><img src="userprofiles/<%=resultID %>.jpg" width="50" height="50"></td>
             <td align="center"><a href="profile.jsp?id=<%=resultID%>"><%=User.getName(resultID) %></a></td>
         </tr>
	<%} %>
	</table>
        </div> <!-- /content-in -->
        
        
        <div class="content-bottom"></div>
	<%if(results.size() > (pageNum+1)*10) { %><a href="searchresults.jsp?page=<%=pageNum+1%>">more</a><%} %>
    </div> <!-- /content -->
<%@ include file="footer.jsp" %>